<%@ page language="java"
	import="java.util.ArrayList"
	contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>admin/salesManagement/" />
		<link href="<%=basePath%>css/skin.css" rel="stylesheet" type="text/css" />
		<SCRIPT type="text/javascript" src="<%=basePath%>js/jquery.js"></SCRIPT>
		<SCRIPT type="text/javascript" src="<%=basePath%>admin/salesManagement/js/update.js"></SCRIPT>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #EEF2FB;
}

-->
.tdinput {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	height: 22px;
	border: 0;
	width: 100%;
}
</style>
<script type="text/javascript">
 function changeState(obj, checkList) {
		if(obj.checked == true) {
			if(checkList != null && checkList.length == null) {
				checkList.checked = true;
			}
			for(var i=0; i<checkList.length; i++) {
				checkList[i].checked = true;
			}
		}
		else {
			if(checkList != null && checkList.length == null) {
				checkList.checked = false;
			}
			for(var i=0; i<checkList.length; i++) {
				checkList[i].checked = false;
			}
		}
}
</script>
	</head>
	<body>
		<table width="100%" border="0" cellpadding="0" cellspacing="0">
			<tr>
				<td width="17" valign="top"
					background="<%=basePath%>images/mail_leftbg.gif">
					<img src="<%=basePath%>images/left-top-right.gif" width="17"
						height="29" />
				</td>
				<td valign="top" background="<%=basePath%>images/content-bg.gif">
					<table width="100%" height="31" border="0" cellpadding="0"
						cellspacing="0" class="left_topbg" id="table2">
						<tr>
							<td height="31">
								<div class="titlebt">
									添加退货单
								</div>
							</td>

						</tr>
					</table>
				</td>
				<td width="16" valign="top"
					background="<%=basePath%>images/mail_rightbg.gif">
					<img src="<%=basePath%>images/nav-right-bg.gif" width="16" height="29" />
				</td>
			</tr>
			<tr>
				<td valign="middle" background="<%=basePath%>images/mail_leftbg.gif">
					&nbsp;
				</td>
				<td valign="top" bgcolor="#F7F8F9">
					<table width="98%" border="0" align="center" cellpadding="0"
						cellspacing="0">
						<tr>
							<td height="26" background="<%=basePath%>images/newlinebg3.gif">

								<table width="98%" border="0" cellspacing="0" cellpadding="0">
									<tr>
										<td align="center">
												<a href="sellBackList" class="coolbg">销售退货列表</a>
												<a href="SellBackMain-add.jsp" class="coolbg">增加退货单信息</a>
												<a href="Customer-search.jsp" class="coolbg">查询退货单信息</a>
										</td>
									</tr>
								</table>
								<form action="updateSellBack" method="post">
									<table width="98%" border="0" cellpadding="2" cellspacing="1"
										bgcolor="#D1DDAA" align="center" style="margin-top: 8px">
										<tr bgcolor="#E6EDF2">
											<td height="24" colspan="12"
												background="<%=basePath%>images/tbg.gif">
												&nbsp;
												<input type="checkbox" class="coolbg" name="all"
													onclick="changeState(this, selectedList);" value="check" />
												<label class="coolbg">
													全选
												</label>
												&nbsp;
												<!-- 
												<input class="coolbg1" type="button" value="添加一行" id="addline">|
												<input class="coolbg1" type="button" value="删除一行" id="removeline">
												 -->
											</td>
										</tr>
										<tr align="center" bgcolor="#EEF4EA" height="22">
											<td width="3%">选择</td>
											<td width="4%">编号</td>
											<td width="7%">代理人</td>
											<td width="7%">支付方式</td>
											<td width="8%">下单时间</td>
											<td width="6%">客户</td>
										</tr>
										<s:iterator value="sellBackMain" var="s">
										<tr align='center' bgcolor="#FFFFFF"
											onMouseMove="javascript:this.bgColor='#FCFDEE';"
											onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22">
											<input type="hidden" name="sellBackMain.id" value="<s:property value="#s.id"/>"/>
											<td>
												<input type="checkbox" id="selectedList" name="selectedList" value="0" class="np">
											</td>
											<td>
												<input width="100%" type="text" class="tdinput" name="sellBackMain.number" value="<s:property value="#s.number"/>"/>
											</td>
											<td>
												<input width="100%" type="text" class="tdinput" name="sellBackMain.agent" value="<s:property value="#s.agent"/>"/>
											</td>
											<td>
												<input width="100%" type="text" class="tdinput" name="sellBackMain.settlementMethod" value="<s:property value="#s.settlementMethod"/>"/>
											</td>
											<td>
												<input width="100%" type="text" class="tdinput" name="sellBackMain.sellTime" value="<s:property value="#s.sellTime"/>"/>
											</td>
											<td>
												<input width="100%" type="text" class="tdinput" name="customer.customer_name" value="<s:property value="#s.customer.customer_name"/>"/>
											</td>
										</tr>
										</s:iterator>
										
										<tr align='center' bgcolor="#FFFFFF"
											onMouseMove="javascript:this.bgColor='#FCFDEE';"
											onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22">
											<td colspan="6">
												<table width="60%" border="0" cellpadding="2" cellspacing="1"
														bgcolor="#D1DDAA" align="center" style="margin-top: 8px" id="datatable">
													<tr align="center" bgcolor="#EEF4EA" height="22">
														<td width="7%">选择</td>
														<td width="23%">商品</td>
														<td width="30%">数量</td>
													</tr>
													<s:iterator value="sellBackDetails" var="sb">
													<tr align='center' bgcolor="#FFFFFF"
														onMouseMove="javascript:this.bgColor='#FCFDEE';"
														onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22" id="appendId0">
														<input type="hidden" name="sellBackDetails[0].id" value="<s:property value="#sb.id"/>"/>
														<td>
															<input width="100%" type="checkbox" id="selectedList" name="selectedList" value="0" class="np">
														</td>
														<td>
															<input width="100%" type="text" class="tdinput" name="commoditys[0].commodity_name" value="<s:property value="#sb.commodity.commodity_name"/>"/>
														</td>
														<td>
															<input width="100%" type="text" class="tdinput" name="sellBackDetails[0].quantity" value="<s:property value="#sb.quantity"/>"/>
														</td>
													</tr>
													</s:iterator>
												</table>
											</td>
										</tr>
										<tr bgcolor="#FAFAF1">
											<td height="28" colspan="12">
												<input type="submit" value="提交" class="coolbg" />
												<input type="button" value="返回" class="coolbg" onclick="history.back(); return false;"/>
											</td>
										</tr>
										<tr align="right" bgcolor="#EEF4EA">
											<td height="36" colspan="12" align="center">

												<!--换页-->
											</td>
										</tr>
									</table>
								</form>
							</td>
						</tr>
					</table>
				</td>
				<td background="<%=basePath%>images/mail_rightbg.gif">
					&nbsp;
				</td>
			</tr>
			<tr>
				<td valign="bottom" background="<%=basePath%>images/mail_leftbg.gif">
					<img src="<%=basePath%>images/buttom_left2.gif" width="17" height="17" />
				</td>
				<td background="<%=basePath%>images/buttom_bgs.gif">
					<img src="<%=basePath%>images/buttom_bgs.gif" width="17" height="17">
				</td>
				<td valign="bottom" background="<%=basePath%>images/mail_rightbg.gif">
					<img src="<%=basePath%>images/buttom_right2.gif" width="16" height="17" />
				</td>
			</tr>
		</table>
	</body>
</html>
